<template>
  <div id="assessdetail">
    <el-dialog title="新增部领导选票" :visible.sync="leaderTicketVisible" top="20px">
      <leaderticket :myid='this.$route.params.id' :leaders="leaderszhengzhi" @refreshevent="submitsuccess" :timestamp="timestamp"></leaderticket>
    </el-dialog>
    <el-dialog title="查看部领导选票" :visible.sync="leaderTicketDetailVisible" top="20px">
      <leaderticketdetail :myid='this.$route.params.id' :ticketid='ticketid' :leaders="leaderszhengzhi"></leaderticketdetail>
    </el-dialog>
    <el-dialog title="您对加强和改进本地区（单位）干部选拔任用工作有何意见建议？" :visible.sync="dtopic7Visible" top="20px">
      <div class="wboxd">
      <el-table :data="dtopic7content" highlight-current-row v-loading="dtopic7listLoading" style="width: 100%;" border>
        <el-table-column type="index" label="序号" width="50" align="center" class-name="tableth">
        </el-table-column>
        <el-table-column prop="content" label="内容">
        </el-table-column>
      </el-table>
      </div>
    </el-dialog>
    <el-dialog title="您对加强和改进“一报告两评议”工作有何意见建议？" :visible.sync="dtopic8Visible" top="20px">
      <div class="wboxd">
      <el-table :data="dtopic8content" highlight-current-row v-loading="dtopic8listLoading" style="width: 100%;" border>
        <el-table-column type="index" label="序号" width="50" align="center" class-name="tableth">
        </el-table-column>
        <el-table-column prop="content" label="内容">
        </el-table-column>
      </el-table>
      </div>
    </el-dialog>
    <el-dialog :title="theYear===2023?'您对新提拔任用的干部表示不认同的主要原因是：':'您对新提拔任用的干部（请具体到人）表示不认同的主要原因是：'" :visible.sync="dtopic9Visible" top="20px">
      <div class="wboxd">
      <el-table :data="dtopic9content" highlight-current-row v-loading="dtopic9listLoading" style="width: 100%;" border>
        <el-table-column type="index" label="序号" width="50" align="center" class-name="tableth">
        </el-table-column>
        <el-table-column prop="content" label="内容">
        </el-table-column>
      </el-table>
      </div>
    </el-dialog>
    <el-breadcrumb separator=">">
      <el-breadcrumb-item :to="{ path: '/' }">系统首页</el-breadcrumb-item>
      <el-breadcrumb-item :to="{ path: '/assess' }">干部考核</el-breadcrumb-item>
      <el-breadcrumb-item>项目详情</el-breadcrumb-item>
    </el-breadcrumb>
    <section class="wboxs">
      <div style="padding:15px 15px 0;">单位编码：<b style="padding-right:40px;">{{unitcode}}</b>年度：<b style="padding-right:40px;">{{theYear}}</b>单位名称：<b style="padding-right:40px;">{{unitname}}</b>主管领导：<b>{{inmanagleader}}</b></div>
    </section>
    <el-row>
      <el-col style="background:#fff;margin:0 10px; padding:0;" class="assessdetail">
        <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tab-pane name="zhunbei">
            <span slot="label">基本情况</span>
            <div :style="'height:'+tableHeight+'px;'">
              <el-scrollbar style="height: calc(100% + 17px);">
                <baseinfo :prjdata='prjdata' :myid='this.$route.params.id'></baseinfo>
              </el-scrollbar>
            </div>
          </el-tab-pane>
          <!-- <el-tab-pane name="leader" v-if="leaders&&leaders.length>0">
            <span slot="label">录入部领导选票</span>

            <div :style="'height:'+tableHeight+'px;'" class="wboxd">
              <el-scrollbar style="height: calc(100% + 17px);">
                <el-button type="primary" @click.native="leaderticket(0)" style="margin:10px 10px 0;">新增部领导选票</el-button>

                <el-table :data="ticketLeaderList" highlight-current-row v-loading="ticketLeaderListLoading" style="width: 100%; margin-top:10px;border-top:1px solid #95B8E7;border-bottom:1px solid #95B8E7" border>
                  <el-table-column label=" " width="80" fixed align="center" class-name="tableth">
                    <template slot-scope="scope">
                      选票{{scope.$index+1}}
                    </template>
                  </el-table-column>
                  <el-table-column label="选票类型" width="300">
                    <template>
                      部领导选票
                    </template>
                  </el-table-column>
                  <el-table-column label="录入时间" width="200">
                    <template slot-scope="scope">
                      {{dateFtt("yyyy-MM-dd hh:mm:ss",scope.row.createTime)}}
                    </template>
                  </el-table-column>
                  <el-table-column prop="name" label="操作">
                    <template slot-scope="scope">
                      <el-button type="infor" size="small" @click="leaderticketshow(scope.row.id)" style="margin:10px 0;">查看</el-button>
                      <el-button type="danger" size="small" @click="ticketdel(scope.row.id)" style="margin:10px 0;">删除</el-button>
                    </template>
                  </el-table-column>
                </el-table>
              </el-scrollbar>
            </div>
          </el-tab-pane> -->
          <el-tab-pane name="jieguo">
            <span slot="label">投票结果分析</span>
            <div :style="'height:'+tableHeight+'px;'">
              <el-scrollbar style="height: calc(100% + 17px);">
              <el-upload style="margin:10px;float:left" class="upload-demo" :before-upload="beforeAvatarUpload" :on-success="getImportList" name="file" :file-list="fileList"
                  :action="this.$http.defaults.baseURL + 'api/prj/uploadresult/'+this.$route.params.id" with-credentials :on-error='uploaderror' accept="rsprj">
                <el-button type="success" icon="el-icon-document">导入投票结果</el-button>
              </el-upload>
                <el-tabs class="cardtab" v-model="resultActiveName" v-if="ticketinfoshow" style="clear:both;margin:10px;" type="border-card">
                  <el-tab-pane name="ticket">
                    <span slot="label">外网选票情况</span>
                    <table class="tickettable" id="tickettable1" cellspacing="0">
                      <tr>
                        <th colspan="2">选票类型</th>
                        <!-- <th>单位主要领导票数</th> -->
                        <th>年度考核票数</th>
                        <th>A类选票数</th>
                        <th>B类选票数</th>
                      </tr>
                      <tr>
                        <th colspan="2">生成选票</th>
                        <!-- <td v-html="fured(tabledata.ALL[0])"></td> -->
                        <td v-html="fured(tabledata.ALL[1])"></td>
                        <td v-html="fured(tabledata.ALL[2])"></td>
                        <td v-html="fured(tabledata.ALL[3])"></td>
                      </tr>
                      <tr>
                        <th rowspan="3" width="100">发出选票</th>
                        <th width="100">已投选票</th>
                        <!-- <td v-html="fured(tabledata.YITOU[0])"></td> -->
                        <td v-html="fured(tabledata.YITOU[1])"></td>
                        <td v-html="fured(tabledata.YITOU[2])"></td>
                        <td v-html="fured(tabledata.YITOU[3])"></td>
                      </tr>
                      <tr>
                        <th>未投选票</th>
                        <!-- <td v-html="fured(tabledata.WEITOU[0])"></td> -->
                        <td v-html="fured(tabledata.WEITOU[1])"></td>
                        <td v-html="fured(tabledata.WEITOU[2])"></td>
                        <td v-html="fured(tabledata.WEITOU[3])"></td>
                      </tr>
                      <tr>
                        <th>作废选票</th>
                        <!-- <td v-html="fured(tabledata.ZUOFEI[0])"></td> -->
                        <td v-html="fured(tabledata.ZUOFEI[1])"></td>
                        <td v-html="fured(tabledata.ZUOFEI[2])"></td>
                        <td v-html="fured(tabledata.ZUOFEI[3])"></td>
                      </tr>
                      <tr>
                        <th colspan="2">剩余未发出选票</th>
                        <!-- <td v-html="fured(tabledata.SHENGYU[0])"></td> -->
                        <td v-html="fured(tabledata.SHENGYU[1])"></td>
                        <td v-html="fured(tabledata.SHENGYU[2])"></td>
                        <td v-html="fured(tabledata.SHENGYU[3])"></td>
                      </tr>
                    </table>
                  </el-tab-pane>
                  <el-tab-pane name="unit" v-if="leaders&&leaders.length>0">
                    <span slot="label">领导班子年度考核结果</span>
                    <table class="tickettable" id="tickettable2" cellspacing="0" v-if="kaohe">
                      <tr>
                        <!-- <th>机构名称</th> -->
                        <th rowspan="2">评分人身份</th>
                        <th rowspan="2">{{theYear===2023?'政治素质':'政治思想建设'}}<br>（25分）</th>
                        <th rowspan="2">领导能力<br>（20分）</th>
                        <th rowspan="2">工作实绩<br>（20分）</th>
                        <th rowspan="2">工作作风<br>（20分）</th>
                        <th rowspan="2">党风廉政建设<br>（15分）</th>
                        <th rowspan="2">总分</th>
                        <th colspan="4">总体评价（单位：张）</th>
                      </tr>
                      <tr>
                        <th>优秀</th>
                        <th>良好</th>
                        <th>一般</th>
                        <th>较差</th>
                      </tr>
                      <tr v-if="kaohe.Lingdao_Banzi&&kaohe.Lingdao_Banzi!==null">
                        <!-- <td rowspan="3">单位</td> -->
                        <th>外部评价</th>
                        <!-- <td>{{kaohe.Lingdao_Banzi.dtopic1}}</td>
                        <td>{{kaohe.Lingdao_Banzi.dtopic2}}</td>
                        <td>{{kaohe.Lingdao_Banzi.dtopic3}}</td>
                        <td>{{kaohe.Lingdao_Banzi.dtopic4}}</td>
                        <td>{{kaohe.Lingdao_Banzi.dtopic5}}</td>
                        <td>{{kaohe.Lingdao_Banzi.all}}</td> -->
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td>{{kaohe.Lingdao_Banzi.all}}</td>
                        <td>{{kaohe.Lingdao_Banzi.msg?kaohe.Lingdao_Banzi.msg.split('@')[0]:''}}</td>
                        <td>{{kaohe.Lingdao_Banzi.msg?kaohe.Lingdao_Banzi.msg.split('@')[1]:''}}</td>
                        <td>{{kaohe.Lingdao_Banzi.msg?kaohe.Lingdao_Banzi.msg.split('@')[2]:''}}</td>
                        <td>{{kaohe.Lingdao_Banzi.msg?kaohe.Lingdao_Banzi.msg.split('@')[3]:''}}</td>
                      </tr>
                      <tr v-else>
                        <!-- <td rowspan="3">单位</td> -->
                        <th>外部评价</th>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                      </tr>
                      <tr v-if="kaohe.Qunzhong_Banzi&&kaohe.Qunzhong_Banzi!==null">
                        <th>单位测评</th>
                        <td>{{kaohe.Qunzhong_Banzi.dtopic1}}</td>
                        <td>{{kaohe.Qunzhong_Banzi.dtopic2}}</td>
                        <td>{{kaohe.Qunzhong_Banzi.dtopic3}}</td>
                        <td>{{kaohe.Qunzhong_Banzi.dtopic4}}</td>
                        <td>{{kaohe.Qunzhong_Banzi.dtopic5}}</td>
                        <td>{{kaohe.Qunzhong_Banzi.all}}</td>
                        <td>{{kaohe.Qunzhong_Banzi.msg?kaohe.Qunzhong_Banzi.msg.split('@')[0]:''}}</td>
                        <td>{{kaohe.Qunzhong_Banzi.msg?kaohe.Qunzhong_Banzi.msg.split('@')[1]:''}}</td>
                        <td>{{kaohe.Qunzhong_Banzi.msg?kaohe.Qunzhong_Banzi.msg.split('@')[2]:''}}</td>
                        <td>{{kaohe.Qunzhong_Banzi.msg?kaohe.Qunzhong_Banzi.msg.split('@')[3]:''}}</td>
                      </tr>
                      <tr v-else>
                        <!-- <td rowspan="3">单位</td> -->
                        <th>单位测评</th>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                      </tr>
                      <tr v-if="kaohe.All_Banzi&&kaohe.All_Banzi!==null">
                        <th style="color:#00f;font-weight:bolder">综合</th>
                        <!-- <td style="color:#00f">{{kaohe.All_Banzi.dtopic1}}</td>
                        <td style="color:#00f">{{kaohe.All_Banzi.dtopic2}}</td>
                        <td style="color:#00f">{{kaohe.All_Banzi.dtopic3}}</td>
                        <td style="color:#00f">{{kaohe.All_Banzi.dtopic4}}</td>
                        <td style="color:#00f">{{kaohe.All_Banzi.dtopic5}}</td>
                        <td style="color:#00f">{{kaohe.All_Banzi.all}}</td> -->
                        <td style="color:#00f"></td>
                        <td style="color:#00f"></td>
                        <td style="color:#00f"></td>
                        <td style="color:#00f"></td>
                        <td style="color:#00f"></td>
                        <td style="color:#00f">{{kaohe.All_Banzi.all}}</td>
                        <td style="color:#00f"></td>
                        <td style="color:#00f"></td>
                        <td style="color:#00f"></td>
                        <td style="color:#00f"></td>
                      </tr>
                      <tr v-else>
                        <!-- <td rowspan="3">单位</td> -->
                        <th>综合</th>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                      </tr>
                    </table>
                  </el-tab-pane>
                  <el-tab-pane name="leader" v-if="leaders&&leaders.length>0">
                    <span slot="label">干部年度考核结果</span>
                    <table class="tickettable" id="tickettable3" cellspacing="0" v-if="kaohe">
                      <tr>
                        <th rowspan="2">姓名</th>
                        <!-- <th rowspan="2">评分人身份</th> -->
                        <th rowspan="2">德（25分）</th>
                        <th rowspan="3">能（20分）</th>
                        <th rowspan="2">勤（15分）</th>
                        <th rowspan="2">绩（25分）</th>
                        <th rowspan="2">廉（15分）</th>
                        <th rowspan="2">总分</th>
                        <th colspan="4">总体评价（单位：张）</th>
                      </tr>
                      <tr>
                        <th>优秀</th>
                        <th>称职</th>
                        <th>基本称职</th>
                        <th>不称职</th>
                      </tr>
                      <tbody v-for="(item,index) in leaders" :key="index">
                        <!-- <tr v-if="kaohe['Lingdao_'+item.code]&&kaohe['Lingdao_'+item.code]!==null">
                          <th rowspan="3">{{item.inname}}</th>
                          <th>领导</th>
                          <td>{{kaohe['Lingdao_'+item.code].topic1}}</td>
                          <td>{{kaohe['Lingdao_'+item.code].topic2}}</td>
                          <td>{{kaohe['Lingdao_'+item.code].topic3}}</td>
                          <td>{{kaohe['Lingdao_'+item.code].topic4}}</td>
                          <td>{{kaohe['Lingdao_'+item.code].topic5}}</td>
                          <td>{{kaohe['Lingdao_'+item.code].topic6}}</td>
                          <td>{{kaohe['Lingdao_'+item.code].topic7}}</td>
                          <td>{{kaohe['Lingdao_'+item.code].topic8}}</td>
                          <td>{{kaohe['Lingdao_'+item.code].topic9}}</td>
                          <td>{{kaohe['Lingdao_'+item.code].topic10}}</td>
                          <td>{{kaohe['Lingdao_'+item.code].topic11}}</td>
                          <td>{{kaohe['Lingdao_'+item.code].all}}</td>
                          <td>{{kaohe['Lingdao_'+item.code].msg.split('@')[0]}}</td>
                          <td>{{kaohe['Lingdao_'+item.code].msg.split('@')[1]}}</td>
                          <td>{{kaohe['Lingdao_'+item.code].msg.split('@')[2]}}</td>
                          <td>{{kaohe['Lingdao_'+item.code].msg.split('@')[3]}}</td>
                        </tr>
                        <tr v-else>
                          <th rowspan="3">{{item.inname}}</th>
                          <th>领导</th>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                        </tr> -->
                        <tr v-if="kaohe['Qunzhong_'+item.code]&&kaohe['Qunzhong_'+item.code]!==null">
                          <th>{{item.inname}}</th>
                          <!-- <th>群众</th> -->
                          <td>{{kaohe['Qunzhong_'+item.code].topic1}}</td>
                          <td>{{kaohe['Qunzhong_'+item.code].topic3}}</td>
                          <td>{{kaohe['Qunzhong_'+item.code].topic6}}</td>
                          <td>{{kaohe['Qunzhong_'+item.code].topic8}}</td>
                          <td>{{kaohe['Qunzhong_'+item.code].topic10}}</td>
                          <td>{{kaohe['Qunzhong_'+item.code].all}}</td>
                          <td>{{kaohe['Qunzhong_'+item.code].msg.split('@')[0]}}</td>
                          <td>{{kaohe['Qunzhong_'+item.code].msg.split('@')[1]}}</td>
                          <td>{{kaohe['Qunzhong_'+item.code].msg.split('@')[2]}}</td>
                          <td>{{kaohe['Qunzhong_'+item.code].msg.split('@')[3]}}</td>
                        </tr>
                        <tr v-else>
                          <th>{{item.inname}}</th>
                          <!-- <th>群众</th> -->
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                        </tr>
                        <!-- <tr v-if="kaohe['All_'+item.code]&&kaohe['All_'+item.code]!==null">
                          <th style="color:#00f;font-weight:bolder">综合</th>
                          <td style="color:#00f">{{kaohe['All_'+item.code].topic1}}</td>
                          <td style="color:#00f">{{kaohe['All_'+item.code].topic2}}</td>
                          <td style="color:#00f">{{kaohe['All_'+item.code].topic3}}</td>
                          <td style="color:#00f">{{kaohe['All_'+item.code].topic4}}</td>
                          <td style="color:#00f">{{kaohe['All_'+item.code].topic5}}</td>
                          <td style="color:#00f">{{kaohe['All_'+item.code].topic6}}</td>
                          <td style="color:#00f">{{kaohe['All_'+item.code].topic7}}</td>
                          <td style="color:#00f">{{kaohe['All_'+item.code].topic8}}</td>
                          <td style="color:#00f">{{kaohe['All_'+item.code].topic9}}</td>
                          <td style="color:#00f">{{kaohe['All_'+item.code].topic10}}</td>
                          <td style="color:#00f">{{kaohe['All_'+item.code].topic11}}</td>
                          <td style="color:#00f">{{kaohe['All_'+item.code].all}}</td>
                          <td style="color:#00f">{{kaohe['All_'+item.code].msg.split('@')[0]}}</td>
                          <td style="color:#00f">{{kaohe['All_'+item.code].msg.split('@')[1]}}</td>
                          <td style="color:#00f">{{kaohe['All_'+item.code].msg.split('@')[2]}}</td>
                          <td style="color:#00f">{{kaohe['All_'+item.code].msg.split('@')[3]}}</td>
                        </tr>
                        <tr v-else>
                          <th>综合</th>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                          <td></td>
                        </tr> -->
                      </tbody>
                    </table>
                  </el-tab-pane>
                  <el-tab-pane name="unitpingyi" v-if="tabledata.ALL[2]>0||tabledata.ALL[3]>0">
                    <span slot="label">选人用人工作民主评议结果</span>
                    <table class="tickettable" id="tickettable4" cellspacing="0">
                      <tr>
                        <th rowspan="2" width="30">序号</th>
                        <th rowspan="2" width="420">题目</th>
                        <th colspan="5">选票（单位：张）</th>
                      </tr>
                      <tr>
                        <th width="100">选票类型</th>
                        <th>好</th>
                        <th>较好</th>
                        <th>一般</th>
                        <th>差</th>
                      </tr>
                      <tbody v-for="(item,index) in topictext" :key="index">
                        <tr>
                          <th rowspan="3">{{index+1}}</th>
                          <th rowspan="3" style="text-align:left">{{item}}</th>
                          <th>A类选票</th>
                          <td v-if="pingyi.A_Banzi&&pingyi.A_Banzi!==null">{{pingyi.A_Banzi["dtopic"+(index+1)].split(',')[0]}}</td>
                          <td v-else></td>
                          <td v-if="pingyi.A_Banzi&&pingyi.A_Banzi!==null">{{pingyi.A_Banzi["dtopic"+(index+1)].split(',')[1]}}</td>
                          <td v-else></td>
                          <td v-if="pingyi.A_Banzi&&pingyi.A_Banzi!==null">{{pingyi.A_Banzi["dtopic"+(index+1)].split(',')[2]}}</td>
                          <td v-else></td>
                          <td v-if="pingyi.A_Banzi&&pingyi.A_Banzi!==null">{{pingyi.A_Banzi["dtopic"+(index+1)].split(',')[3]}}</td>
                          <td v-else></td>
                        </tr>
                        <tr>
                          <th>B类选票</th>
                          <td v-if="pingyi.B_Banzi&&pingyi.B_Banzi!==null">{{pingyi.B_Banzi["dtopic"+(index+1)].split(',')[0]}}</td>
                          <td v-else></td>
                          <td v-if="pingyi.B_Banzi&&pingyi.B_Banzi!==null">{{pingyi.B_Banzi["dtopic"+(index+1)].split(',')[1]}}</td>
                          <td v-else></td>
                          <td v-if="pingyi.B_Banzi&&pingyi.B_Banzi!==null">{{pingyi.B_Banzi["dtopic"+(index+1)].split(',')[2]}}</td>
                          <td v-else></td>
                          <td v-if="pingyi.B_Banzi&&pingyi.B_Banzi!==null">{{pingyi.B_Banzi["dtopic"+(index+1)].split(',')[3]}}</td>
                          <td v-else></td>
                        </tr>
                        <tr>
                          <th style="color:#00f;font-weight:bolder">总选票</th>
                          <td v-if="pingyi.All_Banzi&&pingyi.All_Banzi!==null" style="color:#00f">{{pingyi.All_Banzi["dtopic"+(index+1)].split(',')[0]}}</td>
                          <td v-else></td>
                          <td v-if="pingyi.All_Banzi&&pingyi.All_Banzi!==null" style="color:#00f">{{pingyi.All_Banzi["dtopic"+(index+1)].split(',')[1]}}</td>
                          <td v-else></td>
                          <td v-if="pingyi.All_Banzi&&pingyi.All_Banzi!==null" style="color:#00f">{{pingyi.All_Banzi["dtopic"+(index+1)].split(',')[2]}}</td>
                          <td v-else></td>
                          <td v-if="pingyi.All_Banzi&&pingyi.All_Banzi!==null" style="color:#00f">{{pingyi.All_Banzi["dtopic"+(index+1)].split(',')[3]}}</td>
                          <td v-else></td>
                        </tr>
                      </tbody>
                      <tr>
                        <th>4</th>
                        <th colspan="6" style="text-align:left">您认为本地区（单位）干部选拔任用工作存在的主要问题是什么？（可多选）</th>
                      </tr>
                      <tbody v-for="(item,index) in optiontext" :key="'op'+index">
                        <tr>
                          <th rowspan="3"></th>
                          <th rowspan="3" style="text-align:left">{{item}}</th>
                          <th>A类选票</th>
                          <td colspan="4" v-if="pingyi.A_Banzi&&pingyi.A_Banzi!==null">{{pingyi.A_Banzi.dtopic6[index]}}</td>
                          <td colspan="4" v-else></td>
                        </tr>
                        <tr>
                          <th>B类选票</th>
                          <td colspan="4" v-if="pingyi.B_Banzi&&pingyi.B_Banzi!==null">{{pingyi.B_Banzi.dtopic6[index]}}</td>
                          <td colspan="4" v-else></td>
                        </tr>
                        <tr>
                          <th style="color:#00f;font-weight:bolder">总选票</th>
                          <td colspan="4" v-if="pingyi.All_Banzi&&pingyi.All_Banzi!==null" style="color:#00f">{{pingyi.All_Banzi.dtopic6[index]}}</td>
                          <td colspan="4" v-else></td>
                        </tr>
                      </tbody>
                      <tr>
                        <th rowspan="3">5</th>
                        <th rowspan="3" style="text-align:left">您对加强和改进本地区（单位）干部选拔任用工作有何意见建议？</th>
                        <th>A类选票</th>
                        <td colspan="4" v-if="pingyi.A_Banzi&&pingyi.A_Banzi!==null">
                          <div v-if="pingyi.A_Banzi.dtopic7Num===0">0条</div>
                          <div v-else>
                            <el-button size="small" @click="showdtopic7(pingyi.A_Banzi.dtopic7)" type="text" icon="el-icon-search">{{pingyi.A_Banzi.dtopic7Num}}条</el-button>
                          </div>
                        </td>
                        <td colspan="4" v-else></td>
                      </tr>
                      <tr>
                        <th>B类选票</th>
                        <td colspan="4" v-if="pingyi.B_Banzi&&pingyi.B_Banzi!==null">
                          <div v-if="pingyi.B_Banzi.dtopic7Num===0">0条</div>
                          <div v-else>
                            <el-button size="small" @click="showdtopic7(pingyi.B_Banzi.dtopic7)" type="text" icon="el-icon-search">{{pingyi.B_Banzi.dtopic7Num}}条</el-button>
                          </div>
                        </td>
                        <td colspan="4" v-else></td>
                      </tr>
                      <tr>
                        <th style="color:#00f;font-weight:bolder">总选票</th>
                        <td colspan="4" v-if="pingyi.All_Banzi&&pingyi.All_Banzi!==null" style="color:#00f">
                          <div v-if="pingyi.All_Banzi.dtopic7Num===0">0条</div>
                          <div v-else>
                            <el-button size="small" @click="showdtopic7(pingyi.All_Banzi.dtopic7)" type="text" icon="el-icon-search">{{pingyi.All_Banzi.dtopic7Num}}条</el-button>
                          </div>
                        </td>
                        <td colspan="4" v-else></td>
                      </tr>
                      <tr>
                        <th rowspan="3">6</th>
                        <th rowspan="3" style="text-align:left">您对加强和改进“一报告两评议”工作有何意见建议？</th>
                        <th>A类选票</th>
                        <td colspan="4" v-if="pingyi.A_Banzi&&pingyi.A_Banzi!==null">
                          <div v-if="pingyi.A_Banzi.dtopic8Num===0">0条</div>
                          <div v-else>
                            <el-button size="small" @click="showdtopic8(pingyi.A_Banzi.dtopic8)" type="text" icon="el-icon-search">{{pingyi.A_Banzi.dtopic8Num}}条</el-button>
                          </div>
                        </td>
                        <td colspan="4" v-else></td>
                      </tr>
                      <tr>
                        <th>B类选票</th>
                        <td colspan="4" v-if="pingyi.B_Banzi&&pingyi.B_Banzi!==null">
                          <div v-if="pingyi.B_Banzi.dtopic8Num===0">0条</div>
                          <div v-else>
                            <el-button size="small" @click="showdtopic8(pingyi.B_Banzi.dtopic8)" type="text" icon="el-icon-search">{{pingyi.B_Banzi.dtopic8Num}}条</el-button>
                          </div>
                        </td>
                        <td colspan="4" v-else></td>
                      </tr>
                      <tr>
                        <th style="color:#00f;font-weight:bolder">总选票</th>
                        <td colspan="4" v-if="pingyi.All_Banzi&&pingyi.All_Banzi!==null" style="color:#00f">
                          <div v-if="pingyi.All_Banzi.dtopic8Num===0">0条</div>
                          <div v-else>
                            <el-button size="small" @click="showdtopic8(pingyi.All_Banzi.dtopic8)" type="text" icon="el-icon-search">{{pingyi.All_Banzi.dtopic8Num}}条</el-button>
                          </div>
                        </td>
                        <td colspan="4" v-else></td>
                      </tr>
                    </table>
                  </el-tab-pane>
                  <el-tab-pane name="leaderpingyi" v-if="preferments&&preferments.length>0">
                    <span slot="label">新提拔干部民主评议结果</span>
                    <table class="tickettable" id="tickettable5" cellspacing="0">
                      <tr>
                        <th colspan="6">被评议对象的基本情况</th>
                        <th colspan="5">对提拔该干部的看法（单位：张）</th>
                      </tr>
                      <tr>
                        <th width="30">序号</th>
                        <th>姓名</th>
                        <th>出生年月</th>
                        <th>原任职务及任职时间</th>
                        <th>现任职务</th>
                        <th>任现职时间</th>
                        <th width='100'>选票类型</th>
                        <th>认同</th>
                        <th>基本认同</th>
                        <th>不认同</th>
                        <th>不了解</th>
                      </tr>
                      <tbody v-for="(item,index) in preferments" :key="index">
                        <tr>
                          <th rowspan="3">{{index+1}}</th>
                          <td rowspan="3">{{item.inname}}</td>
                          <td rowspan="3">{{item.inchusheng}}</td>
                          <td rowspan="3">{{item.inyuanzhiwu}}</td>
                          <td rowspan="3">{{item.inxianzhiwu}}</td>
                          <td rowspan="3">{{MyGetDateStr(item.inrenzhishijian)}}</td>
                          <th>A类选票</th><td>{{pingyi['A_'+item.code].split('@')[0]}}</td><td>{{pingyi['A_'+item.code].split('@')[1]}}</td><td>{{pingyi['A_'+item.code].split('@')[2]}}</td><td>{{pingyi['A_'+item.code].split('@')[3]}}</td>
                        </tr>
                        <tr>
                          <th>B类选票</th><td>{{pingyi['B_'+item.code].split('@')[0]}}</td><td>{{pingyi['B_'+item.code].split('@')[1]}}</td><td>{{pingyi['B_'+item.code].split('@')[2]}}</td><td>{{pingyi['B_'+item.code].split('@')[3]}}</td>
                        </tr>
                        <tr>
                          <th style="color:#00f;font-weight:bolder">全部选票</th><td style="color:#00f">{{pingyi['All_'+item.code].split('@')[0]}}</td><td style="color:#00f">{{pingyi['All_'+item.code].split('@')[1]}}</td><td style="color:#00f">{{pingyi['All_'+item.code].split('@')[2]}}</td><td style="color:#00f">{{pingyi['All_'+item.code].split('@')[3]}}</td>
                        </tr>
                      </tbody>
                    </table>
                    <table class="tickettable" id="tickettable6" cellspacing="0">
                      <tr>
                        <th rowspan="3" style="text-align:left;width:350px">
                          {{theYear===2023?'您对新提拔任用的干部表示不认同的主要原因是：':'您对新提拔任用的干部（请具体到人）表示不认同的主要原因是：'}}
                        </th>
                        <th style="width:200px">A类选票</th>
                        <td colspan="4" v-if="pingyi.A_Banzi&&pingyi.A_Banzi!==null">
                          <div v-if="pingyi.A_Banzi.dtopic9Num===0">0条</div>
                          <div v-else>
                            <el-button size="small" @click="showdtopic9(pingyi.A_Banzi.dtopic9)" type="text" icon="el-icon-search">{{pingyi.A_Banzi.dtopic9Num}}条</el-button>
                          </div>
                        </td>
                        <td colspan="4" v-else></td>
                      </tr>
                      <tr>
                        <th>B类选票</th>
                        <td colspan="4" v-if="pingyi.B_Banzi&&pingyi.B_Banzi!==null">
                          <div v-if="pingyi.B_Banzi.dtopic9Num===0">0条</div>
                          <div v-else>
                            <el-button size="small" @click="showdtopic9(pingyi.B_Banzi.dtopic9)" type="text" icon="el-icon-search">{{pingyi.B_Banzi.dtopic9Num}}条</el-button>
                          </div>
                        </td>
                        <td colspan="4" v-else></td>
                      </tr>
                      <tr>
                        <th style="color:#00f;font-weight:bolder">总选票</th>
                        <td colspan="4" v-if="pingyi.All_Banzi&&pingyi.All_Banzi!==null" style="color:#00f">
                          <div v-if="pingyi.All_Banzi.dtopic9Num===0">0条</div>
                          <div v-else>
                            <el-button size="small" @click="showdtopic9(pingyi.All_Banzi.dtopic9)" type="text" icon="el-icon-search">{{pingyi.All_Banzi.dtopic9Num}}条</el-button>
                          </div>
                        </td>
                        <td colspan="4" v-else></td>
                      </tr>
                    </table>
                  </el-tab-pane>
                  <el-tab-pane>
                    <span slot="label">报表</span>
                    <div style="margin-bottom:10px;" v-if="leaders&&leaders.length>0">
                      <font style="width:150px;display:block;float:left;line-height:40px;font-weight:bolder;text-align:center">年度考核</font>
                      <el-button type="primary" @click.native="export_kaoheyuanshi">原始选票</el-button>
                    </div>
                    <div v-if="tabledata.ALL[2]>0||tabledata.ALL[3]>0">
                      <font style="width:150px;display:block;float:left;line-height:40px;font-weight:bolder;text-align:center">一报告两评议</font>
                      <el-button type="primary" @click.native="export_pingyiyuanshi">原始选票</el-button>
                      <el-button type="primary" @click.native="export_pingyifenxi">结果分析表</el-button>
                    </div>
                  </el-tab-pane>
                </el-tabs>
              </el-scrollbar>
            </div>
          </el-tab-pane>
        </el-tabs>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import baseinfo from '@/assess/Baseinfo2023.vue'
import leaderticket from '@/components/VoteTemp1.vue'
import leaderticketdetail from '@/components/VoteDetailTemp.vue'
export default {
  components: {
    leaderticket,
    baseinfo,
    leaderticketdetail
  },
  data () {
    return {
      theYear: '',
      prjdata: {},
      topictext: [
        '对本地区（单位）干部选拔任用工作的总体评价',
        '对本地区（单位）加强干部全方位管理和经常性监督情况的评价',
        '对本上一年度评议反映问题整改情况的评价'
      ],
      optiontext: [],
      optiontext2023: [
        '①聚焦落实党中央要求和本地区（单位）职责使命加强领导班子和干部队伍建设不够',
        '②干部队伍建设统筹谋划不够、干部队伍结构不优',
        '③干部队伍能力素质不适应工作要求',
        '④干部队伍精神状态不佳或斗争精神不足',
        '⑤选人用人突出政治标准不够，严把政治关、廉洁关不到位',
        '⑥选人用人注重工作实绩、群众公认不够',
        '⑦激励担当作为有差距，推进领导干部能上能下不力',
        '⑧选人用人落实民主集中制不到位，存在“个人说了算”',
        '⑨坚持五湖四海、任人唯贤不够，存在任人唯亲、搞小圈子等不正之风',
        '⑩执行干部选拔任用政策和程序不规范',
        '⑪选人用人工作中跑风漏气',
        '⑫对“一把手”、关键岗位等管理监督不够严格，存在薄弱环节',
        '⑬中央巡视及部党组巡视选人用人专项检查反馈问题整改落实不到位',
        '⑭以上问题均不存在'
      ],
      optiontext2024: [
        '①聚焦落实党中央要求和本地区（单位）职责使命加强领导班子和干部队伍建设不够',
        '②干部队伍建设统筹谋划不够、干部队伍结构不优',
        '③干部队伍能力素质不适应工作要求',
        '④干部队伍精神状态不佳或斗争精神不足',
        '⑤选人用人突出政治标准不够，严把政治关、廉洁关不到位',
        '⑥选人用人注重工作实绩、群众公认不够',
        '⑦激励担当作为有差距，推进领导干部能上能下不力',
        '⑧选人用人落实民主集中制不到位，存在“个人说了算”',
        '⑨坚持五湖四海、任人唯贤不够，存在任人唯亲、搞小圈子等不正之风',
        '⑩执行干部选拔任用政策和程序不规范',
        '⑪选人用人工作中跑风漏气',
        '⑫对“一把手”、关键岗位等管理监督不够严格，存在薄弱环节',
        '⑬部党组巡视选人用人专项检查反馈问题整改落实不到位',
        '⑭以上问题均不存在'
      ],
      dtopic7Visible: false,
      dtopic7content: [],
      dtopic7listLoading: false,
      dtopic8Visible: false,
      dtopic8content: [],
      dtopic8listLoading: false,
      dtopic9Visible: false,
      dtopic9content: [],
      dtopic9listLoading: false,
      leaders: [],
      leaderszhengzhi: [],
      preferments: [],
      unitpoint: [1, 2, 3, 4, 5, 6],
      leaderpoint: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
      showdata: false,
      fileList: [],
      resultActiveName: 'ticket',
      ticketid: 0,
      leaderTicketVisible: false,
      leaderTicketDetailVisible: false,
      ticketLeaderList: [],
      ticketLeaderListLoading: false,
      activeName: 'zhunbei',
      unitcode: '',
      unitname: '',
      inmanagleader: '',
      ticketinfoshow: false,
      kaohe: {},
      pingyi: {},
      tabledata: {'ZUOFEI': ['', '', '', ''], 'ALL': ['', '', '', ''], 'YITOU': ['', '', '', ''], 'SHENGYU': ['', '', '', ''], 'WEITOU': ['', '', '', '']},
      tableHeight: 100,
      timestamp: ''
    }
  },
  methods: {
    fured (val) {
      if (val < 0) {
        return '<font color="red">' + val + '</font>'
      } else {
        return val
      }
    },
    export_kaoheyuanshi () {
      window.open(this.$http.defaults.baseURL + 'api/prj/kaoheyuanshiticket/' + this.$route.params.id)
    },
    export_pingyiyuanshi () {
      window.open(this.$http.defaults.baseURL + 'api/prj/pingyiyuanshiticket/' + this.$route.params.id)
    },
    export_pingyifenxi () {
      window.open(this.$http.defaults.baseURL + 'api/prj/pingyifenxiticket/' + this.$route.params.id)
    },
    handleClick () {
      this.changerowcolor('tickettable1')
      this.changerowcolor('tickettable2')
      this.changerowcolor('tickettable3')
      this.changerowcolor('tickettable4')
      this.changerowcolor('tickettable5')
      this.changerowcolor('tickettable6')
    },
    changerowcolor (id) {
      let rows = document.getElementById(id)
      // if (id === 'tickettable2') {
      if (rows) {
        console.log('rows')
        console.log(rows)
        let add = function () {
          this.style.backgroundColor = '#F5F7FA'
        }
        let del = function () {
          this.style.backgroundColor = '#fff'
        }
        for (var m = rows.firstChild; m != null; m = m.nextSibling) {
          m.onmouseover = add
          m.onmouseout = del
        }
      }
    },
    showdtopic7 (str) {
      this.dtopic7listLoading = true
      this.dtopic7Visible = true
      this.dtopic7content = []
      let _this = this
      str.split('@').forEach(element => {
        let item = {}
        item.content = element
        _this.dtopic7content.push(item)
      })
      this.dtopic7listLoading = false
    },
    showdtopic8 (str) {
      this.dtopic8listLoading = true
      this.dtopic8Visible = true
      this.dtopic8content = []
      let _this = this
      str.split('@').forEach(element => {
        let item = {}
        item.content = element
        _this.dtopic8content.push(item)
      })
      this.dtopic8listLoading = false
    },
    showdtopic9 (str) {
      this.dtopic9listLoading = true
      this.dtopic9Visible = true
      this.dtopic9content = []
      let _this = this
      str.split('@').forEach(element => {
        let item = {}
        item.content = element
        _this.dtopic9content.push(item)
      })
      this.dtopic9listLoading = false
    },
    leaderticketshow (id) {
      this.leaderTicketDetailVisible = true
      this.ticketid = id
      console.log('ticketid:' + this.ticketid)
    },
    ticketdel (id) {
      this.$confirm('确认删除该记录吗?', '提示', {
        type: 'error'
      }).then(() => {
        var _this = this
        this.$http.post(`/api/ticket/remove/` + id).then(function (response) {
          if (response.data.success === true) {
            _this.$message({
              message: '删除成功',
              type: 'success'
            })
          } else {
            console.log('删除失败:' + response.data.message)
            _this.$message({
              message: '删除失败:' + response.data.message,
              type: 'error'
            })
          }
          _this.getTicket()
          _this.getResult()
        })
      })
    },
    beforeAvatarUpload (file) {
      console.log('文件类型')
      console.log(file.name)
      const isFormat = file.name.indexOf('.rsprj') > 0
      // const isLt5M = file.size / 1024 / 1024 < 500
      if (!isFormat) {
        this.$message.error('上传文件只能是 .rsprj 格式!')
      }
      return isFormat
    },
    // 获取用户列表
    getImportList (res) {
      if (res.success) {
        this.$message({
          message: '导入成功！' + res.message,
          type: 'success'
        })
        this.getResult()
      } else {
        console.log(res.Msg)
        this.$message({
          message: '导入失败:' + res.message,
          type: 'error'
        })
      }
      this.fileList = []
    },
    uploaderror (err) {
      console.log('具体错误')
      console.log(err)
      this.$message({
        message: '导入失败，可能是文件大小超出系统限制:' + err,
        type: 'error'
      })
    },
    leaderticket (id) {
      this.leaderTicketVisible = true
      this.ticketid = id
      this.timestamp = new Date().getTime()
      console.log('timestamp:' + this.timestamp)
    },
    importresult () {
      this.$router.push('/assess/importresult/' + this.$route.params.id)
    },
    backtolist () {
      this.$router.push('/assess')
    },
    mainheight (obj) {
      var clientHeight = 0
      if (document.body.clientHeight && document.documentElement.clientHeight) {
        clientHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight
      } else {
        clientHeight = (document.body.clientHeight > document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight
      }
      obj.$nextTick(function () {
        obj.tableHeight = clientHeight - 240
      })
    },
    getDetails () {
      var _this = this
      this.$http
        .get(`/api/prj/details/` + this.$route.params.id)
        .then(function (response) {
          _this.prjdata = response.data
          console.log('_this.prjdata')
          console.log(_this.prjdata)
          _this.unitcode = response.data.project.code
          _this.unitname = response.data.project.inname
          _this.inmanagleader = response.data.project.inmanagleader
          _this.leaders = response.data.leaders
          _this.theYear = response.data.project.theYear
          _this.optiontext = (_this.theYear === 2023 ? _this.optiontext2023 : _this.optiontext2024)
          _this.leaders.forEach(element => {
            if (element.zhiwu === '正职') {
              _this.leaderszhengzhi.push(element)
            }
          })
          _this.preferments = response.data.preferments
        })
        .catch(function (error) {
          console.log(error)
          _this.$message({
            message: '网络获取失败:' + error,
            type: 'error'
          })
        })
    },
    getTicket () {
      var _this = this
      this.$http
        .get(`/api/ticket/list/` + this.$route.params.id)
        .then(function (response) {
          _this.ticketLeaderList = response.data
        })
        .catch(function (error) {
          console.log(error)
          _this.$message({
            message: '网络获取失败:' + error,
            type: 'error'
          })
        })
    },
    getResult () {
      var _this = this
      this.$http
        .get(`/api/prj/result/` + this.$route.params.id)
        .then(function (response) {
          if (response.data.ticketinfo) {
            _this.ticketinfoshow = true
            _this.tabledata = JSON.parse(response.data.ticketinfo)
            _this.kaohe = response.data.kaohe
            _this.pingyi = response.data.pingyi
          } else {
            _this.ticketinfoshow = false
          }
        })
        .catch(function (error) {
          console.log(error)
          _this.$message({
            message: '网络获取失败:' + error,
            type: 'error'
          })
        })
    },
    submitsuccess () {
      console.log('提交成功，返回父组建')
      this.leaderTicketVisible = false
      this.getTicket()
      this.getResult()
    }
  },
  mounted () {
    this.mainheight(this)
    let _this = this
    window.onresize = function windowResize () {
      // 通过捕获系统的onresize事件触发我们需要执行的事件
      _this.mainheight(_this)
    }
    this.getDetails()
    this.getResult()
    this.getTicket()
  }
}
</script>
<style>
#assessdetail .el-upload-list__item{
  width: 250px;
}
#assessdetail a{
  width: 200px;
}
.assessdetail .el-tabs__header{
  height: 29px;
  background: #FAFAFA;
  line-height: 30px;
  font-family: '宋体';
  padding:0 20px;
  border-bottom: 2px solid #E4E7ED;
  margin:0;
}
.assessdetail .el-tabs__item{
  line-height: 30px;
  height: 30px;
  font-weight:bolder;
}
  .cardtab .el-tabs__header{
    padding:0 !important;
    border-bottom:1px solid #E4E7ED;
  }
  #assessdetail .wboxs{
    height:45px;
    padding-top:0;
    margin-bottom: 10px;
  }
  .wboxs{
    padding:5px 15px;
    width: calc(100% - 30px);
    background: #fff;
    border: 1px solid #95B8E7;
    margin:0 10px;
    overflow: hidden;
  }
</style>

<style scoped>
  .tickettable th{
    font-weight:lighter;
    background-image: linear-gradient(to bottom , #f8f8f8, #efefef);
    text-align: center;
  }
  .tickettable{
    width: 100%;
    border-left: 1px solid #95B8E7;
    border-top: 1px solid #95B8E7;
  }
  .tickettable td, .tickettable th{
    padding:5px 10px;
    margin:0;
    font-size:var(--size14) !important;
    line-height: 20px;
    font-family: '宋体';
    border-bottom: 1px solid #95B8E7;
    border-right: 1px solid #95B8E7;
  }
  .tickettable td{
    vertical-align: middle;
    text-align: center;
    font-weight: bolder;
  }
  .mytable{
    border-top: 1px solid #74a6cc;
    border-left: 1px solid #74a6cc;
    margin:0 10px 10px;
    width: calc(100% - 20px);
  }
  .mytable th{
    padding: 10px;
    border-right: 1px solid #74a6cc;
    border-bottom: 1px solid #74a6cc;
    vertical-align: top;
    line-height: 150%;
    background: #FAFAFA;
    width:200px;
    text-align:right;
  }
  .mytable td{
    padding: 10px;
    border-right: 1px solid #74a6cc;
    border-bottom: 1px solid #74a6cc;
    vertical-align: top;
    line-height: 150%;
  }
</style>
